#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time    : 2021/11/9 3:02 上午
# @Author  : WangZhixing
import os
import pandas as pd

def result2rsf_file(root,preds, outfilepath):
    namepath = os.path.join(root,"processed","idx.name.csv")
    name = pd.read_csv(namepath, sep=" ",header=None)
    with open(outfilepath, 'w') as f:
        for i in range(len(preds)):
            f.write("contain" + " " + str(preds[i]) + " " + name[1][i] + '\n')